package com.richinfo.proxy.dynamic.cglib;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

/**
 * Created by WangXJ
 * 2019-07-04 14:58
 */
public class DemoMethodInterceptor implements MethodInterceptor {

	@Override
	public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
		System.out.println("before in cglib");
		
		Object result = null;
		result = proxy.invokeSuper(obj, args);
		
		System.out.println("after in cglib");
		
		return result;
	}

}
